//
//  NSString+RBAdd.h
//  Culture
//
//  Created by Lan on 2017/9/7.
//  Copyright © 2017年 SummerTea. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSString(RBAdd) 

/* 中文算两个字符,英文一个,emoji四个 */
- (NSInteger)charCount;
- (NSString *)rbText;
- (NSInteger)rbLength;

#pragma mark - HEX↔字符串
- (NSString *)hexString;
- (NSString *)stringFromHexString;

#pragma mark - 格式验证

/** 是否通过正则 */
- (BOOL)rbValidateWithExpression: (NSString *)expression;

/** 纯中文验证 */
- (BOOL)rbChinese;
/** 纯数字验证 */
- (BOOL)rbNumber;
/** 纯字母 */
- (BOOL)rbChar;
/** 字母/数字 */
- (BOOL)rbCharNum;
/** 6-12位字母和数字组合的密码 */
- (BOOL)rbPassword;
/** 手机号验证 */
- (BOOL)rbPhone;
/** 身份证验证 */
- (BOOL)rbIdCardNum;
/** email验证 */
- (BOOL)rbEmail;

#pragma mark - 字符串比较(用于数字)

- (BOOL)biggerThanString: (NSString *)string;
- (BOOL)smallerThanString: (NSString *)string;

- (BOOL)biggerEqualToString: (NSString *)string;
- (BOOL)smallerEqualToString: (NSString *)string;

#pragma mark - 版本号比较
//上架时候,发布版本最好和构建版本相同

- (BOOL)biggerThanVersion: (NSString *)version;
- (BOOL)smallerThanVersion: (NSString *)version;

- (BOOL)biggerEqualToVersion: (NSString *)version;
- (BOOL)smallerEqualToVersion: (NSString *)version;

@end
